<!DOCTYPE html>
<html class="no-js" lang="">
<head>#include( "/public-head.html")</head>

<body style="background-color: #ffffff !important;">
	<div class="main-content checkbo">
		<div class="panel mb25">
			<div class="panel-heading border">修改专辑</div>
			<div class="panel-body">
				<div class="row no-margin">
						<form action="/vrs/musicalbum/edit.jsn" data-url="/vrs/musicalbum/list.jsn" id="musicAlbumForm" name="ajaxForm"
							class="form-horizontal bordered-group" role="form">

							<div class="form-group">
								<label class="col-sm-2 control-label">专辑id</label>
								<div class="col-sm-10">
									<input type="hidden" name="musicAlbum.id" value="$!{musicAlbum.id}">
									<input type="text"  class="form-control w100" value="$!{musicAlbum.id}" placeholder="专辑id" disabled="">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">名称<code>*</code></label>
								<div class="col-sm-10">
									<input type="text" required name="musicAlbum.name" value="$!{musicAlbum.name}" class="form-control w150" placeholder="名称">
								</div>
							</div>
							<textarea id="standardPic" name="musicAlbum.standardPic" rows="5" cols="100" class="hidden">$!{musicAlbum.standardPic}</textarea>
						<div class="form-group">
	                            <label class="col-sm-2 control-label">专辑配图<code>*</code></label>
	                            <div id="picDiv" class="col-sm-10" data-theme-name="upload-image">
	
	                                <div  data-theme-name="upload-image-div" class="pull-left" >
	                                    <div class="pull-left mr10">
	                                        <select data-placeholder="请选择终端" required data-theme-name="terminal"  class="chosen w100" >
	                                            <option value="0">缩略图</option>
	                                            <option value="1">锁屏图</option>
	                                        </select><br/>
	                                    </div>
	                                    <div class="pull-left mr10">
	                                        <label data-theme-name="upload-image-label">
	                                            <img src="/images/upload_1242x416.jpg" name="" data-theme-name="view-image" width="248" height="82">
	                                            <img src="/images/wait.gif" width="40" height="40" data-theme-name="wait-image" >
	                                            <input type="file" name="image"  />
	                                            <input name="root" value="album" style="display: none"  />
	                                        </label>
	                                    </div>
                                </div>
                                <div class="pull-left mr10">
                                    <button type="button" class="btn btn-primary" data-theme-name="add-upload-image" >添<br/>加</button>
                                </div>
                            </div>
                        </div>
							<div class="form-group">
	                            <label class="col-sm-2 control-label">艺人<code>*</code></label>
	                            <div class="col-sm-10">
	                                <select id="starrSelect" required data-placeholder="请选择艺人"  multiple class="chosen" name="musicAlbum.starringIds" style="width: 60%;">
	                                    <option value=""></option>
	                                    #if($starringList)
		                                    #foreach( $row in $!{starringList})
		                                    <option value="$!{row.starringId}">$!{row.name}</option>
		                                    #end
	                                    #end
	                                </select>
	                            </div>
	                        </div>
	                        <div class="form-group">
                            <label class="col-sm-2 control-label">年代<code>*</code></label>
                            <div class="col-sm-10">
                                <select id="yearSelect" required data-placeholder="请选择年代" class="chosen w150" name="musicAlbum.age">
                                    <option value=""></option>
                                    #if($yearList)
                                        #foreach( $row in $!{yearList})
                                        <option value="$!{row.id}">$!{row.name}</option>
                                        #end
                                    #end
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">版权<code>*</code></label>
                            <div class="col-sm-10">
                                <select id="copyrightSelect" required data-placeholder="请选择版权" class="chosen w150" name="musicAlbum.copyrightCompeny.copyrightCompanyId">
                                    <option value=""></option>
                                    #if($copyrightCompanyList)
                                        #foreach( $row in $!{copyrightCompanyList})
                                        <option value="$!{row.copyrightCompanyId}">$!{row.name}</option>
                                        #end
                                    #end
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
	                            <label class="col-sm-2 control-label">厂牌<code>*</code></label>
	                            <div class="col-sm-10">
	                                <select id="labelSelect" required data-placeholder="请选择厂牌"  class="chosen" name="musicAlbum.label" style="width: 40%;">
	                                    <option value=""></option>
	                                    #if($labelMap)
	                                        #foreach( $row in $!{labelMap.entrySet()})
	                                        <option value="$!{row.key}">$!{row.value}</option>
	                                        #end
	                                    #end
	                                </select>
	                            </div>
	                        </div>
	                        <div class="form-group">
	                            <label class="col-sm-2 control-label">分类<code>*</code></label>
	                            <div class="col-sm-10">
	                                <select id="categorySelect" required data-placeholder="请选择分类" multiple class="chosen" name="musicAlbum.categoryIds" style="width: 60%;">
	                                    <option value=""></option>
	                                    #if($categroyMap)
	                                        #foreach( $row in $!{categroyMap})
	                                        <option value="$!{row.categoryId}">$!{row.name}</option>
	                                        #end
	                                    #end
	                                </select>
	                            </div>
	                        </div>
	                        <div class="form-group">
	                            <label class="col-sm-2 control-label">标签<code>*</code></label>
	                            <div class="col-sm-10">
	                                <input id="tags" type="text" required name="musicAlbum.tag" data-decimals="每输入一个标签回车结束" value="" />
	                            </div>
	                        </div>
	                        <div class="form-group">
	                            <label class="col-sm-2 control-label">备注</label>
	                            <div class="col-sm-10">
									<textarea class="form-control" id="description"  name="musicAlbum.description" rows="3">$!{musicAlbum.description}</textarea>
								</div>
	                        </div>
	                        <div class="form-group">
	                            <label class="col-sm-2 control-label">是否上线<code>*</code></label>
	                            <div id="isDisplayRadio" class="col-sm-10">
	                                <label class="cb-radio">
	                                    <input type="radio" required name="musicAlbum.isdisplay" value="1" />上线
	                                </label>
	                                <label class="cb-radio">
	                                    <input type="radio" required name="musicAlbum.isdisplay" value="0" />下线
	                                </label>
	                            </div>
	                        </div>
							<div class="form-group">
								<label></label>
								<div>
									<button type="button" onclick="submitPerForm()" class="btn btn-primary mr10">保存</button>
									<button class="btn btn-default">返回</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>


	</div>
	<!-- /main area -->
	#include( "/public-script.html")
	#include( "/sub-script.html") 
	<script>
		//单选
    	initEditSelect('yearSelect','$!{musicAlbum.age}');
    	initEditSelect('labelSelect','$!{musicAlbum.label}');
    	initEditSelect('copyrightSelect','$!{musicAlbum.copyrightCompeny.copyrightCompanyId}');
		//多选
	    initEditSomeSelect('categorySelect','$!{musicAlbum.categoryIds}');
	    //多选
	    initEditSomeSelect('starrSelect','$!{musicAlbum.starringIds}');
	    //输入框
	    initEditInput('tags','$!{musicAlbum.tag}')
	    //配图
	    initEditPic('picDiv','$!{musicAlbum.standardPic}')
	    initEditRadio('isDisplayRadio','$!{musicAlbum.isdisplay}')	    
	    $('#musicAlbumForm').validate();
		//提交
		function submitPerForm() {
			if (!$('#musicAlbumForm').valid()) {
				return false;
			} else {
				$('#musicAlbumForm').submit();
			}
		}
	</script>
</body>

</html>
